<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%-- JSTL表达式（判断，循环，输出） --%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%-- 方法表达式（字符串截取，替换） --%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<c:forEach var="n" items="${pageBean.list}">
<li class="transition">
    <fmt:parseDate value="${n.createTime}" pattern="yyyy-MM-dd" var="createTime"/>
    <div class="container news-box transition">
        <div class="year-box text-center">
            <div class="year">
                <fmt:formatDate value="${createTime}" pattern="yyyy" />
            </div>
            <fmt:formatDate value="${createTime}" pattern="MM.dd" />
        </div>
        <div class="news-content">
            <div class="title">
                ${n.articleTitle}
            </div>
            <div class="content">
                ${n.articleAbstract}
            </div>
            <a class="news-link" href="<%=basePath%>article/getArticleDetails/${n.articleId}">查看更多</a>
        </div>
    </div>
</li>
</c:forEach>

<c:if test="${pageBean.totalPage <= pageBean.currentPage}">
    <script>
        $("#loadNews").html('没有更多了').css("color","#ccc");
    </script>
</c:if>